*This file performs all of the analysis reported in the article and produces the tables and graphs in both the appendix and the article.

*IMPORTANT: Packages to install if not installed (ssc install): did_multiplegt, twowayfeweights, lgraph, estout, plotplainblind, coefplot
*IMPORTANT: Overleaf output directory: change to your own directory

cd "C:\Users\ev42\Dropbox\Apps\Overleaf\EnergyTransition\images"

*Change to where data file is located
use  "C:\Users\ev42\Dropbox\Liss\Data\LisspanelFinal.dta", clear


drop if year<2008 | year>2020

*Assign Variable labels
label define rentGWE 0 "GWE Included" 1 "GWE Not included"
label values rentGWE rentGWE 

label variable leeftijd "Age"
label variable nettohh_f "Hh Income"
label variable oplcat "Education"

gen lninc= ln(nettohh_f+1)
label variable lninc "ln(Hh Income)"
*Drop ineligble voters
drop if leeftijd<18

gen respadult=0
replace respadult=1 if positie<5
label variable respadult "Head of household or partner of head of household"

recode belbezig (1=1) (2=2) (3=2) (4=3) (5=3) (6=3) (7=4) (8=5) (9=6) (10=3) (11=3) (12=3) (else=.), gen(employ)

label define employ 1 "Employed" 2 "Self-employed" 3 "Unemployed/disability" 4 "Student" 5 "Housekeeper" 6 "Pensioner"
label values employ employ

label define educ 1 "primary school" 2 "junior high (vmbo)" 3 "have/vwo (HS)" 4 "mbo (vocational)" 5 "hbo (higher vocational)" 6 "college"
label values oplcat educ

*Create price concern variables
gen price1=0
replace price1=1 if goal1==3
replace price1=. if goal1==.

gen price2=0 
replace price2=1 if goal2==3 | goal1==3
replace price2=. if goal1==.
label variable price1 "Preventing price increases 1st priority"
label variable price2 "Preventing price increases 1st or 2nd priority"

bysort nomem_encr: egen price2013 = total(cond(year == 2013, price1, .))
bysort nomem_encr: egen price2012 = total(cond(year == 2012, price1, .))
bysort nomem_encr: egen price2011 = total(cond(year == 2011, price1, .))

gen pricesens=0
replace pricesens=1 if price2013==1 | price2012==1 |price2011==1
label variabl pricesens "Price sensitive"
*Create energy poverty variable

gen GWEspending=GWEmonthly/nettohh_f

gen energypoor=0
replace energypoor=1 if arrearsutil==1 
replace energypoor=1 if heathome==2
replace energypoor=1 if arrearsutilb==1
replace energypoor=1 if heatadequate==1
replace energypoor=. if respadult==0

  gen energypoor2=0
  replace energypoor2=1 if GWEspending>.1 & GWEspending<.5
  replace energypoor2=0 if respadult==0
   replace energypoor2=0 if rentGWE==0
replace energypoor2=0 if employ==4 


tab energypoor
tab energypoor2
tab energypoor energypoor2, row col
gen energypoorm=max(energypoor, energypoor2)

*Income 
egen incquart=xtile(nettohh_f), n(4) by(year)

*Owners who pay service costs

gen ownservice=99
replace ownservice=0 if service==2
replace ownservice=1 if service==1
replace ownservice=99 if service>2 | service<1
replace ownservice=99 if rentown!=3
replace ownservice=. if ownservice==99

label define os 0 "No service costs" 1 "Service costs"
label values ownservice os 
label variable ownservice "Ownership with Housing Association?"

replace service=. if service>2 | service<0

tab rentGWE year
tab energypoor year
tab energypoor heathome
tab energypoor arrearsutil
tab energypoor heatadequate
 
  sort nomem_encr year
  xtset nomem_encr year
   gen le=l1.energypoorm
    gen le2=l2.energypoorm
	 gen le3=l3.energypoorm
 egen epov=rowmax(energypoorm le le2 le3)
 
label define poor 0 "Not energy poor" 1 "Energy poor"
label values epov poor 
label variable epov "Energy Poverty"

gen Post=Paris
label define postv 0 "Before" 1 "After"
label values Post postv
label variable Post "Post policy change"

gen renter=1
replace renter=0 if rentown==3
label define rent 0 "Owner" 1 "Renter"
label values renter rent 
label variable renter "Own or Rent"

gen multi=0
replace multi=1 if dwelling==5 | dwelling==9

label variable PVVsympmean "Relative sympathy PVV"
label variable GL "Sympathy Green Left"
label variable VVD "Sympathy VVD"
label variable PVDA "Sympathy PvdA"
label variable CDA "Sympathy CDA"
label variable leftright "Left-Right self-placement"
label variable rentGWE "Utilities not included"
label variable oplcat "Education"
label variable employ "Employment status"
label variable EU "Opposition to EU Integration"
label variable immigration "Immigrants must adapt"
label variable extremeright "Vote for the radical right"

 tabulate oplcat, generate(deduc)
 
 tabulate employ, generate(status)
 
foreach i of varlist status1-status6 {
local a : variable label `i'
local a: subinstr local a "employ==" ""
label var `i' "`a'"
}

foreach i of varlist deduc1-deduc6 {
local a : variable label `i'
local a: subinstr local a "oplcat==" ""
label var `i' "`a'"
}
  
  
  
  *Summary tables
  
  	     xtset nomem_encr year
		  bysort nomem_encr (year) : egen minyrs = min(year)
 bysort nomem_encr (year) : egen maxyrs = max(year)
 gen includes=0
 replace includes=1 if minyrs<2015 & maxyrs>2014
  
  est clear
eststo grp1: estpost summ extremeright PVVsympmean GL immigration EU leftright rentGWE epov status1-status6   lninc deduc1-deduc6 status1-status6  if includes==1
eststo grp2: estpost summ  extremeright PVVsympmean GL immigration EU leftright rentGWE epov status1-status6   lninc deduc1-deduc6 status1-status6   if includes==1 & rentGWE<3  // renter only
esttab grp*,  cells("mean(fmt(%6.2fc)) sd  count(fmt(0))")  mtitle("All" "renter")

 
esttab grp* using "summarytable.tex", replace ///
   cells("mean(fmt(%6.2fc)) sd  count(fmt(0))")  nostar nonumber unstack ///
   compress nonote  gap label booktabs    ///
    mtitle("All" "renter")

	
	  *Summary tables
  est clear
eststo grp1: estpost summ extremeright PVVsympmean GL price1 immigration EU leftright status1-status6  lninc deduc1-deduc6 status1-status6 if rentGWE==0 & Post==0 & includes==1
eststo grp2: estpost summ extremeright PVVsympmean GL price1 immigration EU leftright status1-status6   lninc deduc1-deduc6 status1-status6 if rentGWE==1 & Post==0 & includes==1
eststo grp3: estpost summ extremeright PVVsympmean GL price1 immigration EU leftright status1-status6  lninc deduc1-deduc6 status1-status6 if rentGWE==0 & Post==1 & includes==1
eststo grp4: estpost summ extremeright PVVsympmean GL price1 immigration EU leftright status1-status6   lninc deduc1-deduc6 status1-status6 if rentGWE==1 & Post==1 & includes==1

 
esttab grp* using "summarytableGWE.tex", replace f ///
   main(mean %6.2f) aux(sd)    nostar nonumber unstack ///
   compress nonote gap label booktabs    ///
   mtitle("Utils Incl, Pre" "Utils Not Incl, Pre" "Utils Incl, Post"  "Utilities Not Incl, Post")

 *Summary graphs
   est clear
 mean extremeright PVVsympmean GL if Post == 0, over(rentGWE)
eststo Pre
mean extremeright PVVsympmean GL if Post == 1, over(rentGWE)
eststo Post
  coefplot Pre Post , xtitle("Balance between utilities included (or not) pre and post reform") 
  
*Graphs with voting for ER by GWE included

graph drop _all
lgraph extremeright year rentGWE, xline(2014) errortype(ci(95)) xlabel(2008(4)2022) title("Voting for the Radical Right") name(er1) legend(rows(1))

lgraph PVVsympmean year rentGWE, xline(2014)  errortype(ci(95)) xlabel(2008(4)2022) title("Relative Sympathy for PVV") name(er2) 

grc1leg er1 er2, legendfrom(er1) note("Note: Yearly means and 95% confidence intervals", size(vsmall))
graph export er.png, replace
graph drop _all
lgraph GL year rentGWE,  errortype(ci(95)) xlabel(2008(4)2020) title("Sympathy for Green Left") name(glGWE)
lgraph immigration year rentGWE,  errortype(ci(95)) xlabel(2008(4)2020) title("Immigrants should adapt") name(imGWE)
lgraph EU year rentGWE,  errortype(ci(95)) xlabel(2008(4)2020) title("Opposition to EU Integration") name(EUGWE) legend(rows(1))
lgraph leftright year rentGWE,  errortype(ci(95)) xlabel(2008(4)2020) title("Left-Right Placement") name(lrGWE)
lgraph price1 year rentGWE,  errortype(ci(95)) xlabel(2008(4)2020) title("Prevent Price Increases 1st Priority") name(prGWE)
grc1leg EUGWE glGWE imGWE lrGWE, legendfrom(EUGWE) 
graph export OtherGWE.png, replace

grc1leg  glGWE  prGWE EUGWE imGWE lrGWE , legendfrom(EUGWE) 
graph export OtherGWEb.png, replace


graph drop _all
lgraph extremeright year renter,  errortype(ci(95)) xlabel(2008(4)2022) title("Voting for the Radical Right") name(er1) legend(rows(1))

lgraph PVVsympmean year renter,  errortype(ci(95)) xlabel(2008(4)2022) title("Relative Sympathy for PVV") name(er2) 

grc1leg er1 er2, legendfrom(er1) 
graph export erRenter.png, replace

*Regressions for pure diff-in-diff

*Select respondents
 *Check whether people are consistent in reporting whether they pay GWE separately

gen deltaGWE=abs(d.rentGWE)
 bysort nomem_encr (year) : gen cum_GWE = sum(deltaGWE)
 
  *Separate panelids by when people change status
 gen panelidGWE =(nomem_encr +.1*cum_GWE)*10
 bysort panelidGWE (year) : egen minyr = min(year)
 bysort panelidGWE (year) : egen maxyr = max(year)
 gen include=0
 replace include=1 if minyr<2015 & maxyr>2014
    gen ATET=rentGWE
  replace ATET=0 if Paris==0 & rentGWE==1
  *label variable ATET "GWE#Post"
  *DiD regressions with no within-person changes
  
  xtset panelidGWE year
        xtdidregress (extremeright ) (ATET) if include==1, group(panelidGWE ) time(year)  
      xtdidregress (extremeright ) (ATET) if include==1 & multi==1, group(panelidGWE ) time(year)
	  
	   xtdidregress (PVVsympmean) (ATET) if include==1, group(panelidGWE) time(year)
  
        xtdidregress (extremeright i.oplcat i.employ  lninc ) (ATET) if include==1, group(panelidGWE ) time(year)
		

	   xtdidregress (PVVsympmean i.oplcat  i.employ lninc) (ATET) if include==1, group(panelidGWE) time(year)
	   
*Identical estimates using xtreg

	  	  xtreg  extremeright  ATET  i.year if include==1, fe vce(cluster nomem_encr)
	  estimates store M1
  xtreg  PVVsympmean ATET i.year if include==1 , fe vce(cluster nomem_encr)
  estimates store M2
       xtreg  extremeright ATET i.oplcat   lninc i.employ  i.year if include==1, fe vce(cluster nomem_encr)
	   estimates store M3
  xtreg  PVVsympmean ATET i.oplcat lninc i.employ  i.year if include==1, fe vce(cluster nomem_encr)
  estimates store M4
	 
	 *Pretrend tests
	 
	 gen lead1=0
	 replace lead1=rentGWE if year==2013|year==2014
	 	 gen lead2=0
	 replace lead2=rentGWE if year==2012
	 	 gen lead3=0
	 replace lead3=rentGWE if year==2011
	  	 gen D0=0
	 replace D0=rentGWE if year==2015
	 	 gen lag1=0
	 replace lag1=rentGWE if year==2016
	 gen lag2=0
	 replace lag2=rentGWE if year==2017
	 	 gen lag3=0
	 replace lag3=rentGWE if year==2018
	 
xtreg  extremeright lead3 lead2 lead1 D0 lag1 lag2 lag3 rentGWE i.year  i.oplcat   lninc i.employ  if include==1 & (year >2010 & year<2019) & rentGWE<2, fe vce(cluster panelidGWE)
	  
  xtreg  extremeright rentGWE##i.year i.oplcat lninc i.employ  i.year if include==1, fe vce(cluster panelidGWE)
  
  xtreg  PVVsympmean rentGWE##i.year i.oplcat lninc i.employ  i.year if include==1, fe vce(cluster panelidGWE)
	 

	 
 *Estimate by income quartile
         xtreg  extremeright ATET##i.incquart i.oplcat  i.employ  i.year if include==1, fe vce(cluster nomem_encr)
          xtreg  PVVsympmean ATET##i.incquart i.oplcat  i.employ  i.year if include==1, fe vce(cluster nomem_encr)
		      
         xtreg  extremeright ATET i.oplcat  i.employ  i.year if include==1 & incquart<3, fe vce(cluster nomem_encr)
		    xtreg  extremeright ATET i.oplcat  i.employ  i.year if include==1 & incquart>2, fe vce(cluster nomem_encr)
          xtreg  PVVsympmean ATET##i.incquart i.oplcat  i.employ  i.year if include==1, fe vce(cluster nomem_encr)
			  
			  
  
	   *Panel regressions that allow for within person changes
	     xtset nomem_encr year
		  bysort nomem_encr (year) : egen minyr2 = min(year)
		*Only include observations that have at least one before and one after value
 bysort nomem_encr (year) : egen maxyr2 = max(year)
 gen include2=0
 replace include2=1 if minyr2<2015 & maxyr2>2014
		 
	  xtreg  extremeright  ATET rentGWE i.year if include2==1, fe vce(cluster nomem_encr)
	  estimates store M5
  xtreg  PVVsympmean ATET rentGWE i.year if include2==1 , fe vce(cluster nomem_encr)
  estimates store M6
       xtreg  extremeright ATET rentGWE i.oplcat   lninc i.employ  i.year if include2==1, fe vce(cluster nomem_encr)
	   estimates store M7
  xtreg  PVVsympmean ATET rentGWE i.oplcat lninc i.employ  i.year if include2==1, fe vce(cluster nomem_encr)
  estimates store M8
  
  
  coefplot M1 M3 M5 M7 , drop(_cons 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year )  xline(0) yline(0) title("Voting Intention for the Far Right") name(g1)
    coefplot M2 M4 M6 M8 , drop(_cons 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year )  xline(0) yline(0) title("Difference Sympathy for PVV and Mainstream Parties") name(g2)
  
  grc1leg g1 g2, legendfrom(g1) 
graph export regressionsrentGWE.png, replace 
  
 reg rentGWE status1-status6  lninc deduc1-deduc6  if include==1 & Post==0
 estimates store Pre
 reg rentGWE status1-status6  lninc deduc1-deduc6 if include==1 & Post==1
 estimates store Post
 coefplot Pre Post  , drop(_cons )  xline(0) title("Demographics, Renters w/o Utilities vs with Utilities Included") 
 graph export demographics.png, replace 
 
  *Using estout package for LatexTables	  	  
est clear
  xtset panelidGWE year
eststo: xtreg  extremeright  ATET  i.year if include==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  extremeright ATET i.oplcat   lninc i.employ  i.year if include==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  extremeright  ATET rentGWE i.year if include2==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  extremeright ATET rentGWE i.oplcat   lninc i.employ  i.year if include2==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes"

   xtset panelidGWE year
eststo: xtreg  PVVsympmean  ATET  i.year if include==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  PVVsympmean ATET i.oplcat   lninc i.employ  i.year if include==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  PVVsympmean  ATET rentGWE i.year if include2==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  PVVsympmean ATET rentGWE i.oplcat   lninc i.employ  i.year if include2==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 
 
  
esttab using "regression1.tex", replace f   ///
 b(2) se(2) ///
 keep(ATET) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of paying separate utility bill on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
  
  *Table with all the control variables
  esttab using "regression1appendix.tex", replace f   ///
 b(2) se(2) ///
 drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
  
 est clear
 
 
 *Tables with shorter time intervals
 
 
  *Using estout package for LatexTables	  	  
est clear
  xtset panelidGWE year
eststo: xtreg  extremeright  ATET  i.year if include==1 & (year>2010 & year<2018) , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  extremeright ATET i.oplcat   lninc i.employ  i.year if include==1 & (year>2010 & year<2018), fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  extremeright  ATET rentGWE i.year if include2==1 & (year>2010 & year<2018), fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  extremeright ATET rentGWE i.oplcat   lninc i.employ  i.year if include2==1 & (year>2010 & year<2018), fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes"

   xtset panelidGWE year
eststo: xtreg  PVVsympmean  ATET  i.year if include==1 & (year>2010 & year<2018), fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  PVVsympmean ATET i.oplcat   lninc i.employ  i.year if include==1 & (year>2010 & year<2018), fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  PVVsympmean  ATET rentGWE i.year if include2==1 & (year>2010 & year<2018), fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  PVVsympmean ATET rentGWE i.oplcat   lninc i.employ  i.year if include2==1 & (year>2010 & year<2018), fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 
 
  
esttab using "regression1short.tex", replace f   ///
 b(2) se(2) ///
 keep(ATET) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of paying separate utility bill on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
  
  *Table with all the control variables
  esttab using "regression1shortappendix.tex", replace f   ///
 b(2) se(2) ///
 drop(_cons 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year  ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
  
 est clear
 
 *Only multi-family buildings
  
  *Using estout package for LatexTables	  	  
est clear
  xtset panelidGWE year
eststo: xtreg  extremeright  ATET  i.year if include==1 & multi==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  extremeright ATET i.oplcat   lninc i.employ  i.year if include==1 &  multi==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  extremeright  ATET rentGWE i.year if include2==1 & multi==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  extremeright ATET rentGWE i.oplcat   lninc i.employ  i.year if include2==1 & multi==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes"

   xtset panelidGWE year
eststo: xtreg  PVVsympmean  ATET  i.year if include==1 & multi==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  PVVsympmean ATET i.oplcat   lninc i.employ  i.year if include==1 &  multi==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  PVVsympmean  ATET rentGWE i.year if include2==1 & multi==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  PVVsympmean ATET rentGWE i.oplcat   lninc i.employ  i.year if include2==1 &  multi==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 
 
  
esttab using "regression1multi.tex", replace f   ///
 b(2) se(2) ///
 keep(ATET) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of paying separate utility bill on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
  
  *Table with all the control variables
  esttab using "regression1multiappendix.tex", replace f   ///
 b(2) se(2) ///
 drop(_cons 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year  ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
  
 est clear
 
 
  *Only multi-family buildings
  
  *Using estout package for LatexTables	  	  
est clear
  xtset panelidGWE year
eststo: xtreg  extremeright  ATET  i.year if include==1 & incquart<3 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  extremeright ATET i.oplcat   lninc i.employ  i.year if include==1 & incquart<3, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  extremeright  ATET rentGWE i.year if include2==1 & incquart<3, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  extremeright ATET rentGWE i.oplcat   lninc i.employ  i.year if include2==1 & incquart<3, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes"

   xtset panelidGWE year
eststo: xtreg  PVVsympmean  ATET  i.year if include==1 & incquart<3, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  PVVsympmean ATET i.oplcat   lninc i.employ  i.year if include==1 & incquart<3, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  PVVsympmean  ATET rentGWE i.year if include2==1 & incquart<3, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  PVVsympmean ATET rentGWE i.oplcat   lninc i.employ  i.year if include2==1 &  incquart<3, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 
 
  
esttab using "regression1lowinc.tex", replace f   ///
 b(2) se(2) ///
 keep(ATET) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of paying separate utility bill on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
  
  *Table with all the control variables
  esttab using "regression1lowincappendix.tex", replace f   ///
 b(2) se(2) ///
 drop(_cons 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year  ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
  
 est clear
 
 
   *Using estout package for LatexTables	  	  
est clear
  xtset panelidGWE year
eststo: xtreg  extremeright  ATET  i.year if include==1 & incquart>2 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  extremeright ATET i.oplcat   lninc i.employ  i.year if include==1 & incquart>2, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  extremeright  ATET rentGWE i.year if include2==1 & incquart>2, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  extremeright ATET rentGWE i.oplcat   lninc i.employ  i.year if include2==1 & incquart>2, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes"

   xtset panelidGWE year
eststo: xtreg  PVVsympmean  ATET  i.year if include==1 & incquart>2, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  PVVsympmean ATET i.oplcat   lninc i.employ  i.year if include==1 & incquart>2, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  PVVsympmean  ATET rentGWE i.year if include2==1 & incquart>2, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  PVVsympmean ATET rentGWE i.oplcat   lninc i.employ  i.year if include2==1 &  incquart>2, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 
 
  
esttab using "regression1hiinc.tex", replace f   ///
 b(2) se(2) ///
 keep(ATET) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of paying separate utility bill on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
  
  *Table with all the control variables
  esttab using "regression1hiincappendix.tex", replace f   ///
 b(2) se(2) ///
 drop(_cons 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year  ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
  
 est clear
 
 
 
 *Regressions on all parties
 
   *Using estout package for LatexTables	  	  
est clear
  xtset panelidGWE year
eststo: xtreg  GL  ATET i.oplcat   lninc i.employ   i.year if include==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
  eststo: xtreg  SP  ATET i.oplcat   lninc i.employ  i.year if include==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL "Yes"
 estadd local  TV  "No"
 
 
eststo: xtreg  PVDA  ATET i.oplcat   lninc i.employ   i.year if include==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"

 
  eststo: xtreg  D66  ATET i.oplcat   lninc i.employ  i.year if include==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
 
 eststo: xtreg  CDA  ATET i.oplcat   lninc i.employ  i.year if include==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 

eststo: xtreg  VVD  ATET i.oplcat   lninc i.employ  i.year if include==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
  
esttab using "regressionparties.tex", replace f   ///
 b(2) se(2) ///
 keep(ATET) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of paying separate utility bill on support for parties after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Green Left" "SP" "PvdA" "D66" "CDA" "VVD" :, pattern(1 1 1 1 1 1 ) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
  
    
esttab using "regressionparties2.tex", replace f   ///
 b(2) se(2) ///
 drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of paying separate utility bill on support for parties after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Green Left" "SP" "PvdA" "D66" "CDA" "VVD" :, pattern(1 1 1 1 1 1 ) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
 
  
  
 est clear
 
 
 * Time varying coefficient
 
 
 *Regressions on all parties
 
   *Using estout package for LatexTables	  	  
est clear
  xtset nomem_encr year
eststo: xtreg  GL  ATET i.oplcat   lninc i.employ   i.year if include2==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "Yes"
 
  eststo: xtreg  SP  ATET i.oplcat   lninc i.employ  i.year if include2==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL "Yes"
 estadd local  TV  "Yes"
 
 
eststo: xtreg  PVDA  ATET i.oplcat   lninc i.employ   i.year if include2==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "Yes"

 
  eststo: xtreg  D66  ATET i.oplcat   lninc i.employ  i.year if include2==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "Yes"
 
 
 eststo: xtreg  CDA  ATET i.oplcat   lninc i.employ  i.year if include2==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes"
 

eststo: xtreg  VVD  ATET i.oplcat   lninc i.employ  i.year if include2==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "Yes"
 
  
esttab using "regressionpartiebs.tex", replace f   ///
 b(2) se(2) ///
 keep(ATET) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of paying separate utility bill on support for parties after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Green Left" "SP" "PvdA" "D66" "CDA" "VVD" :, pattern(1 1 1 1 1 1 ) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
  
    
esttab using "regressionparties2b.tex", replace f   ///
 b(2) se(2) ///
 drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of paying separate utility bill on support for parties after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Green Left" "SP" "PvdA" "D66" "CDA" "VVD" :, pattern(1 1 1 1 1 1 ) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
 
  
  
 est clear
 

**Chaisemartin et al methods
 xtset panelidGWE year
 
 did_multiplegt extremeright panelidGWE year ATET if include==1, placebo(1) breps(50) cluster(panelidGWE)

 did_multiplegt PVVsympmean panelidGWE year ATET if include==1, placebo(1) breps(50) cluster(panelidGWE)

xtset nomem_encr year

did_multiplegt extremeright panelidGWE year ATET if include==1, placebo(1) breps(50) cluster(nomem_encr)


did_multiplegt PVVsympmean panelidGWE year ATET if include==1, placebo(1) breps(50) cluster(nomem_encr)


 
  xtset panelidGWE year
 did_multiplegt extremeright nomem_encr year ATET if include==1, robust_dynamic dynamic(4) longdiff_placebo placebo(4) breps(50) cluster(panelidGWE)
 
 event_plot e(estimates)#e(variances), default_look ///
	graph_opt(xtitle("Years since policy change (0=2015)") ytitle("Average effect") ///
	xlabel(-4(1)4)) stub_lag(Effect_#) stub_lead(Placebo_#) together
 
 
 
  est clear
 
did_multiplegt extremeright nomem_encr year ATET if include==1, robust_dynamic dynamic(4) longdiff_placebo placebo(4) breps(50) cluster(panelidGWE)

did_multiplegt PVVsympmean panelidGWE year ATET if include==1, placebo(1) breps(50) cluster(panelidGWE)
  
xtset nomem_encr year

 twowayfeweights extremeright nomem_encr year ATET if include2==1, type( feTR) 

 did_multiplegt extremeright nomem_encr year ATET if include2==1, placebo(4) breps(50) cluster(nomem_encr)
 
did_multiplegt extremeright nomem_encr year ATET if include2==1, robust_dynamic dynamic(4) placebo(4) breps(50) cluster(nomem_encr)
 
 
  twowayfeweights PVVsympmean nomem_encr year ATET if include2==1, type( feTR) 
 did_multiplegt PVVsympmean nomem_encr year ATET if include2==1, placebo(2) breps(50) cluster(nomem_encr)

 
did_multiplegt PVVsympmean nomem_encr year ATET if include2==1, robust_dynamic dynamic(4) longdiff_placebo placebo(4) breps(50) cluster(nomem_encr)


 esttab using "regressionmulti.tex", replace f   ///
 b(2) se(2) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of paying separate utility bill on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
 
 
 *Same with other DVs
 est clear
 xtset panelidGWE year
eststo: xtreg  GL  ATET  i.year if include==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  GL ATET  i.oplcat   lninc i.employ  i.year if include==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
  eststo: xtreg  price1  ATET  i.year if include==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  price1 ATET  i.oplcat   lninc i.employ  i.year if include==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 eststo: xtreg  immigration  ATET  i.year if include==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  immigration ATET  i.oplcat   lninc i.employ  i.year if include==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 eststo: xtreg  EU  ATET i.year if include==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  EU ATET  i.oplcat   lninc i.employ  i.year if include==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 eststo: xtreg leftright ATET  i.year if include==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  leftright ATET i.oplcat   lninc i.employ  i.year if include==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 
 
 esttab using "regression1b.tex", replace f  ///
 b(2) se(2) ///
keep (ATET)  ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of paying separate utility bill on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
 mgroups("Sympathy Green Left" "Price Increases Priority" "Immigrants Must Adapt" "Oppose EU Integration" "Left-Right", pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
   
esttab using "regression1bappendix.tex", replace f  ///
 b(2) se(2) ///
 drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of paying separate utility bill on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
 mgroups("Sympathy Green Left" "Price Increases Priority" "Immigrants Must Adapt" "Oppose EU Integration" "Left-Right", pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
  
 
 
 
 
 *Same with other DVs by income quartile
 est clear
 xtset panelidGWE year
eststo: xtreg  GL ATET  i.oplcat   lninc i.employ renter  i.year if include==1  & incquart<3, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Low"
  estadd local  TV  "Yes" 
 eststo: xtreg  GL ATET  i.oplcat   lninc i.employ renter  i.year if include==1  & incquart>2, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "High"
  estadd local  TV  "Yes" 
eststo: xtreg  price1 ATET i.oplcat   lninc i.employ renter  i.year if include==1  & incquart<3, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Low"
  estadd local  TV  "Yes" 
eststo: xtreg  price1 ATET i.oplcat   lninc i.employ renter  i.year if include==1  & incquart>2, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "High"
  estadd local  TV  "Yes" 
eststo: xtreg  immigration ATET  i.oplcat   lninc i.employ  renter i.year if include==1 & incquart<3, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Low"
  estadd local  TV  "Yes" 
eststo: xtreg  immigration ATET  i.oplcat   lninc i.employ  renter i.year if include==1  & incquart>2, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "High"
  estadd local  TV  "Yes" 
eststo: xtreg  EU ATET  i.oplcat   lninc i.employ renter  i.year if include==1 & incquart<3, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Low"
  estadd local  TV  "Yes" 
eststo: xtreg  EU ATET  i.oplcat   lninc i.employ renter  i.year if include==1 & incquart>2, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "High"
  estadd local  TV  "Yes" 
eststo: xtreg  leftright ATET i.oplcat   lninc i.employ renter  i.year if include==1  & incquart<3, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Low"
  estadd local  TV  "Yes" 
eststo: xtreg  leftright ATET i.oplcat   lninc i.employ renter  i.year if include==1  & incquart>2, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "High"
  estadd local  TV  "Yes" 

   
esttab using "regression3cInc.tex", replace f  ///
 b(2) se(2) ///
 keep(ATET ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of energy poverty on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
 mgroups("Sympathy Green Left" "Price Increases Priority" "Immigrants Must adapt" "Oppose EU Integration" "Left-Right" , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Income" "TV Time varying ") sfmt(2)
 
 * Appendix table with all observations, energy poverty
 esttab using "regression3cappendixInc.tex", replace f  ///
 b(2) se(2) ///
 drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of energy poverty on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
 mgroups("Sympathy Green Left" "Price Increases Priority" "Immigrants Must adapt" "Oppose EU Integration" "Left-Right" , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Income" "TV Time varying ") sfmt(2)
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 *Looking at goals
 *Identical estimates using xtreg
xtset panelidGWE year
	  	  xtreg  price1  ATET  i.year if include==1, fe vce(cluster panelidGWE)

	
 
  
  *Same but now for energypoverty
  
   *Matching on 2013 levels

  
  *Same but now for energypoverty
  
   *Matching on 2013 levels
 
   set seed 12345
 
   psmatch2 epov i.oplcat   lninc i.employ renter if year==2013, outcome(extremeright)

   iematch, grpdummy(epov) matchvar( _pscore ) seedok
   gen matchid=nomem_encr if _matchResult==1

   xtset nomem_encr year
		  bysort nomem_encr (year) : egen matchidnew = max(matchid)
		  
		    *Panel regressions that allow for within person changes
	
gen includenew=1 if matchidnew != .
  
 tab includenew epov if year==2013
 
	  *Summary tables
  est clear
eststo grp1: estpost summ extremeright PVVsympmean GL price1 immigration EU leftright status1-status6  lninc deduc1-deduc6 status1-status6 renter if epov==0 & Post==0 & includenew==1  
eststo grp2: estpost summ extremeright PVVsympmean GL price1 immigration EU leftright status1-status6  lninc deduc1-deduc6 status1-status6 renter if epov==0 & Post==1 & includenew==1
eststo grp3: estpost summ extremeright PVVsympmean GL price1 immigration EU leftright status1-status6   lninc deduc1-deduc6 status1-status6 renter if epov==1 & Post==0 & includenew==1
eststo grp4: estpost summ extremeright PVVsympmean GL price1 immigration EU leftright status1-status6   lninc deduc1-deduc6 status1-status6 renter if epov==1 & Post==1 & includenew==1

 
esttab grp* using "summarytablePoverty.tex", replace f ///
   main(mean %6.2f) aux(sd)    nostar nonumber unstack ///
   compress nonote noobs gap label booktabs    ///
   mtitle("Not Energy Poor, Pre" "Not Energy Poor, Post" "Energy Poor, Pre" "Energy Poor, Post")
   
   
graph drop _all
lgraph extremeright year epov if includenew==1,  errortype(ci(95)) xlabel(2008(4)2020) title("Voting for the Radical Right") name(erpov1) legend(rows(1))

lgraph PVVsympmean year epov if includenew==1,  errortype(ci(95)) xlabel(2008(4)2020) title("Relative Sympathy for PVV") name(erpov2) 

grc1leg erpov1 erpov2, legendfrom(erpov1) 
graph export erpov.png, replace 


 gen deltapov=abs(d.epov)
 bysort nomem_encr (year) : gen cum_POV = sum(deltapov)
  *Separate panelids by when people change status
 gen panelidPOV =(nomem_encr +.1*cum_POV)*10
 bysort panelidPOV (year) : egen minyr4 = min(year)
 bysort panelidPOV (year) : egen maxyr4 = max(year)
 gen include3=0
 replace include3=1 if minyr4<2015 & maxyr4>2014
    replace ATET=epov
  replace ATET=0 if Paris==0 & epov==1
  
  *DiD regressions with no within-person changes
  
  xtset panelidPOV year

  
      xtdidregress (extremeright ) (ATET) if include3==1 & includenew==1, group(panelidPOV ) time(year)
	   xtdidregress (PVVsympmean) (ATET) if include3==1 & includenew==1, group(panelidPOV) time(year)
    
        xtdidregress (extremeright i.oplcat i.employ  lninc ) (ATET) if include3==1 & includenew==1, group(panelidPOV ) time(year)
	   xtdidregress (PVVsympmean i.oplcat  i.employ lninc) (ATET) if include3==1 & includenew==1, group(panelidPOV) time(year)

	
	
	*Panel regressions that allow for within person changes
	     xtset nomem_encr year

		*Only include observations that have at least one before and one after value

		   xtreg  extremeright  ATET  i.year if include3==1 & includenew==1, fe vce(cluster nomem_encr)
		    estimates store M9
  xtreg  PVVsympmean ATET  i.year if include3==1 & includenew==1, fe vce(cluster nomem_encr)
   estimates store M10
       xtreg  extremeright ATET i.oplcat  lninc i.employ renter  i.year if include3==1 & includenew==1, fe vce(cluster nomem_encr)
	    estimates store M11
  xtreg  PVVsympmean ATET  i.oplcat lninc i.employ renter  i.year if include3==1 & includenew==1, fe vce(cluster nomem_encr)
   estimates store M12
 
      xtreg  extremeright epov##renter##Post i.oplcat  lninc i.employ   i.year if include3==1 & includenew==1, fe vce(cluster nomem_encr)
 
 *Panel regressions
 
		   xtreg  extremeright  ATET epov i.year if include2==1 & includenew==1, fe vce(cluster nomem_encr)
		    estimates store M13
  xtreg  PVVsympmean ATET epov i.year if include2==1 & includenew==1 , fe vce(cluster nomem_encr)
   estimates store M14
       xtreg  extremeright ATET epov i.oplcat   lninc i.employ renter  i.year if include2==1 & includenew==1, fe vce(cluster nomem_encr)
	    estimates store M15
  xtreg  PVVsympmean ATET epov i.oplcat lninc i.employ renter  i.year if include2==1 & includenew==1, fe vce(cluster nomem_encr)
   estimates store M16


     coefplot M9 M11 M13 M15 , drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year )  xline(0) yline(0) title("Voting Intention for the Far Right") name(g3)
    coefplot M10 M12 M14 M16 , drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year )  xline(0) yline(0) title("Difference Sympathy for PVV and Mainstream Parties") name(g4)
  
  grc1leg g3 g4, legendfrom(g3) 
graph export regressionsepov.png, replace 




  *Using estout package for LatexTables	  	  
est clear
  xtset panelidGWE year
eststo: xtreg  extremeright  ATET  i.year if include==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  extremeright ATET i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  extremeright  ATET epov i.year if include2==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  extremeright ATET epov i.oplcat   lninc i.employ renter i.year if include2==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes"

   xtset panelidGWE year
eststo: xtreg  PVVsympmean  ATET  i.year if include==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  PVVsympmean ATET i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  PVVsympmean  ATET epov i.year if include2==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  PVVsympmean ATET epov i.oplcat   lninc i.employ renter i.year if include2==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 
 
  
esttab using "regression2.tex", replace f   ///
 b(2) se(2) ///
 keep(ATET) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
   label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)

*Table with all the control variables

  *Table with all the control variables
  esttab using "regression2appendix.tex", replace f   ///
 b(2) se(2) ///
 drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)

 
  
**Chaisemartin et al methods
xtset nomem_encr year
did_multiplegt extremeright nomem_encr year ATET if includenew==1, placebo(4) breps(50) cluster(nomem_encr)


 twowayfeweights extremeright nomem_encr year ATET if include2==1, type( feTR) 


 
 *Same with other DVs
 est clear
 xtset panelidGWE year
eststo: xtreg  GL  ATET  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  GL ATET  i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
    eststo: xtreg price1 ATET  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  price1 ATET i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 eststo: xtreg  immigration  ATET  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  immigration ATET  i.oplcat   lninc i.employ  renter i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 eststo: xtreg  EU  ATET i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  EU ATET  i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 eststo: xtreg leftright ATET  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  leftright ATET i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 

   
esttab using "regression2b.tex", replace f  ///
 b(2) se(2) ///
 keep(ATET ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of energy poverty on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
 mgroups("Sympathy Green Left" "Price Increases Priority" "Immigrants Must adapt" "Oppose EU Integration" "Left-Right" , pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
 
 * Appendix table with all observations, energy poverty
 esttab using "regression2bappendix.tex", replace f  ///
 b(2) se(2) ///
 drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of energy poverty on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
 mgroups("Sympathy Green Left" "Price Increases Priority" "Immigrants Must adapt" "Oppose EU Integration" "Left-Right" , pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
 

  *Using estout package for LatexTables	  	  
est clear
  xtset panelidGWE year
eststo: xtreg  extremeright  ATET  i.year if include==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  extremeright ATET i.oplcat   lninc i.employ renter  i.year if include==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  extremeright  ATET epov i.year if include2==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  extremeright ATET epov i.oplcat   lninc i.employ renter i.year if include2==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes"

   xtset panelidGWE year
eststo: xtreg  PVVsympmean  ATET  i.year if include==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  PVVsympmean ATET i.oplcat   lninc i.employ renter  i.year if include==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  PVVsympmean  ATET epov i.year if include2==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  PVVsympmean ATET epov i.oplcat   lninc i.employ renter i.year if include2==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 
 


*Table with all the control variables

  *Table with all the control variables
  esttab using "regression2appendixb.tex", replace f   ///
 b(2) se(2) ///
 drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)

 
  
**Chaisemartin et al methods
xtset nomem_encr year
did_multiplegt extremeright nomem_encr year ATET if includenew==1, placebo(4) breps(50) cluster(nomem_encr)


 twowayfeweights extremeright nomem_encr year ATET if include2==1, type( feTR) 


 
 *Same with other DVs
 est clear
 xtset panelidGWE year
eststo: xtreg  GL  ATET  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  GL ATET  i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
    eststo: xtreg price1 ATET  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  price1 ATET i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 eststo: xtreg  immigration  ATET  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  immigration ATET  i.oplcat   lninc i.employ  renter i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 eststo: xtreg  EU  ATET i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  EU ATET  i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 eststo: xtreg leftright ATET  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  leftright ATET i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 

   
esttab using "regression2b.tex", replace f  ///
 b(2) se(2) ///
 keep(ATET ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of energy poverty on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
 mgroups("Sympathy Green Left" "Price Increases Priority" "Immigrants Must adapt" "Oppose EU Integration" "Left-Right" , pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
 
 * Appendix table with all observations, energy poverty
 esttab using "regression2bappendix.tex", replace f  ///
 b(2) se(2) ///
 drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of energy poverty on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
 mgroups("Sympathy Green Left" "Price Increases Priority" "Immigrants Must adapt" "Oppose EU Integration" "Left-Right" , pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
 

  *Using estout package for LatexTables	  	  
est clear
  xtset panelidGWE year
eststo: xtreg  extremeright  ATET  i.year if include==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  extremeright ATET i.oplcat   lninc i.employ renter  i.year if include==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  extremeright  ATET epov i.year if include2==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  extremeright ATET epov i.oplcat   lninc i.employ renter i.year if include2==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes"

   xtset panelidGWE year
eststo: xtreg  PVVsympmean  ATET  i.year if include==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  PVVsympmean ATET i.oplcat   lninc i.employ renter  i.year if include==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  PVVsympmean  ATET epov i.year if include2==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  PVVsympmean ATET epov i.oplcat   lninc i.employ renter i.year if include2==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 
 


*Table with all the control variables

  *Table with all the control variables
  esttab using "regression2appendixb.tex", replace f   ///
 b(2) se(2) ///
 drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)

 
 
  *Same but now for energypoverty
  
   *Matching on 2013 levels
 
   set seed 12345
 
 drop matchid
 drop includenew
 drop _matchResult
  drop _matchID
  drop _matchDiff
 drop matchidnew
 
    psmatch2 epov i.oplcat   lninc i.employ renter if year==2013, outcome(extremeright)

   iematch, grpdummy(epov) matchvar( _pscore ) seedok
   gen matchid=nomem_encr if _matchResult==1

   xtset nomem_encr year
		  bysort nomem_encr (year) : egen matchidnew = max(matchid)
 
		  
		    *Panel regressions that allow for within person changes
	
gen includenew=1 if matchidnew != .
  
 tab includenew ownservice if year==2013
 
	  *Summary tables
  est clear
eststo grp1: estpost summ extremeright PVVsympmean GL price1 immigration EU leftright status1-status6  lninc deduc1-deduc6 status1-status6 renter if ownservice==0 & Post==0 & includenew==1  
eststo grp2: estpost summ extremeright PVVsympmean GL price1 immigration EU leftright status1-status6   lninc deduc1-deduc6 status1-status6 renter if ownservice==1 & Post==0 & includenew==1
eststo grp3: estpost summ extremeright PVVsympmean GL price1 immigration EU leftright status1-status6  lninc deduc1-deduc6 status1-status6 renter if ownservice==0 & Post==1 & includenew==1

eststo grp4: estpost summ extremeright PVVsympmean GL price1 immigration EU leftright status1-status6   lninc deduc1-deduc6 status1-status6 renter if ownservice==1 & Post==1 & includenew==1

 
esttab grp* using "summarytablownserviceerty.tex", replace f ///
   main(mean %6.2f) aux(sd)    nostar nonumber unstack ///
   compress nonote gap label booktabs    ///
   mtitle("Not Energy Poor, Pre" "Energy Poor, Pre" "Not Energy Poor, Post"  "Energy Poor, Post")
   
   
graph drop _all
lgraph extremeright year ownservice if includenew==1,  errortype(ci(95)) xlabel(2008(4)2020) title("Voting for the Radical Right") name(erpov1b) legend(rows(1))

lgraph PVVsympmean year ownservice if includenew==1,  errortype(ci(95)) xlabel(2008(4)2020) title("Relative Sympathy for PVV") name(erpov2b) 

grc1leg erpov1b erpov2b, legendfrom(erpov1b) 
graph export ownservice.png, replace 

drop deltapov
drop cum_POV minyr4 maxyr4 include3
 gen deltapov=abs(d.ownservice)
 bysort nomem_encr (year) : gen cum_POV = sum(deltapov)
  *Separate panelids by when people change status
  drop panelidPOV
 gen panelidPOV =(nomem_encr +.1*cum_POV)*10
 bysort panelidPOV (year) : egen minyr4 = min(year)
 bysort panelidPOV (year) : egen maxyr4 = max(year)

 gen include3=0
 replace include3=1 if minyr4<2015 & maxyr4>2014
    replace ATET=ownservice
  replace ATET=0 if Paris==0 & ownservice==1
  
  *DiD regressions with no within-person changes
  
  xtset panelidPOV year

  
      xtdidregress (extremeright ) (ATET) if renter==0 & includenew==1, group(nomem_encr ) time(year)
	   xtdidregress (PVVsympmean) (ATET) if include3==1 & includenew==1, group(panelidPOV) time(year)
    
        xtdidregress (extremeright i.oplcat i.employ  lninc ) (ATET) if include3==1 & includenew==1, group(panelidPOV ) time(year)
	   xtdidregress (PVVsympmean i.oplcat  i.employ lninc) (ATET) if include3==1 & includenew==1, group(panelidPOV) time(year)

	
	
	*Panel regressions that allow for within person changes
	     xtset nomem_encr year

		*Only include observations that have at least one before and one after value

		   xtreg  extremeright  ATET  i.year if include3==1 & includenew==1, fe vce(cluster nomem_encr)
		    estimates store M9
  xtreg  PVVsympmean ATET  i.year if include3==1 & includenew==1, fe vce(cluster nomem_encr)
   estimates store M10
       xtreg  extremeright ATET i.oplcat  lninc i.employ renter  i.year if include3==1 & includenew==1, fe vce(cluster nomem_encr)
	    estimates store M11
  xtreg  PVVsympmean ATET  i.oplcat lninc i.employ renter  i.year if include3==1 & includenew==1, fe vce(cluster nomem_encr)
   estimates store M12
 
      xtreg  extremeright ownservice##renter##Post i.oplcat  lninc i.employ   i.year if include3==1 & includenew==1, fe vce(cluster nomem_encr)
 
 *Panel regressions
 
		   xtreg  extremeright  ATET ownservice i.year if include2==1 & includenew==1, fe vce(cluster nomem_encr)
		    estimates store M13
  xtreg  PVVsympmean ATET ownservice i.year if include2==1 & includenew==1 , fe vce(cluster nomem_encr)
   estimates store M14
       xtreg  extremeright ATET ownservice i.oplcat   lninc i.employ renter  i.year if include2==1 & includenew==1, fe vce(cluster nomem_encr)
	    estimates store M15
  xtreg  PVVsympmean ATET ownservice i.oplcat lninc i.employ renter  i.year if include2==1 & includenew==1, fe vce(cluster nomem_encr)
   estimates store M16


     coefplot M9 M11 M13 M15 , drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year )  xline(0) yline(0) title("Voting Intention for the Far Right") name(g3)
    coefplot M10 M12 M14 M16 , drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year )  xline(0) yline(0) title("Difference Sympathy for PVV and Mainstream Parties") name(g4)
  
  grc1leg g3 g4, legendfrom(g3) 
graph export regressionsownservice.png, replace 




  *Using estout package for LatexTables	  	  
est clear
  xtset panelidGWE year
eststo: xtreg  extremeright  ATET  i.year if include==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  extremeright ATET i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  extremeright  ATET ownservice i.year if include2==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  extremeright ATET ownservice i.oplcat   lninc i.employ renter i.year if include2==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes"

   xtset panelidGWE year
eststo: xtreg  PVVsympmean  ATET  i.year if include==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  PVVsympmean ATET i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  PVVsympmean  ATET ownservice i.year if include2==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  PVVsympmean ATET ownservice i.oplcat   lninc i.employ renter i.year if include2==1 & includenew==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 
 
  
esttab using "regression3b.tex", replace f   ///
 b(2) se(2) ///
 keep(ATET) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
   label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)

*Table with all the control variables

  *Table with all the control variables
  esttab using "regression3bappendix.tex", replace f   ///
 b(2) se(2) ///
 drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)

 
 
 
 
 
 
 
 
 
 
 
 
 
 
**Chaisemartin et al methods
xtset nomem_encr year
did_multiplegt extremeright nomem_encr year ATET if includenew==1, placebo(4) breps(50) cluster(nomem_encr)


 twowayfeweights extremeright nomem_encr year ATET if include2==1, type( feTR) 


 
 *Same with other DVs
 est clear
 xtset panelidGWE year
eststo: xtreg  GL  ATET  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  GL ATET  i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
    eststo: xtreg price1 ATET  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  price1 ATET i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 eststo: xtreg  immigration  ATET  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  immigration ATET  i.oplcat   lninc i.employ  renter i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 eststo: xtreg  EU  ATET i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  EU ATET  i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 eststo: xtreg leftright ATET  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  leftright ATET i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 

   
esttab using "regression3c.tex", replace f  ///
 b(2) se(2) ///
 keep(ATET ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of energy poverty on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
 mgroups("Sympathy Green Left" "Price Increases Priority" "Immigrants Must adapt" "Oppose EU Integration" "Left-Right" , pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
 
 * Appendix table with all observations, energy poverty
 esttab using "regression3cappendix.tex", replace f  ///
 b(2) se(2) ///
 drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of energy poverty on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
 mgroups("Sympathy Green Left" "Price Increases Priority" "Immigrants Must adapt" "Oppose EU Integration" "Left-Right" , pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)
 
 
 
 *Same with other DVs
 est clear
 xtset panelidGWE year
eststo: xtreg  GL ATET  i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1 & incquart<3, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Low"
  estadd local  TV  "Yes" 
 eststo: xtreg  GL ATET  i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1 & incquart>2, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "High"
  estadd local  TV  "Yes" 
eststo: xtreg  price1 ATET i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1 & incquart<3, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Low"
  estadd local  TV  "Yes" 
eststo: xtreg  price1 ATET i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1 & incquart>2, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "High"
  estadd local  TV  "Yes" 
eststo: xtreg  immigration ATET  i.oplcat   lninc i.employ  renter i.year if include==1 & includenew==1 & incquart<3, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Low"
  estadd local  TV  "Yes" 
eststo: xtreg  immigration ATET  i.oplcat   lninc i.employ  renter i.year if include==1 & includenew==1 & incquart>2, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "High"
  estadd local  TV  "Yes" 
eststo: xtreg  EU ATET  i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1 & incquart<3, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Low"
  estadd local  TV  "Yes" 
eststo: xtreg  EU ATET  i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1 & incquart>2, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "High"
  estadd local  TV  "Yes" 
eststo: xtreg  leftright ATET i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1 & incquart<3, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Low"
  estadd local  TV  "Yes" 
eststo: xtreg  leftright ATET i.oplcat   lninc i.employ renter  i.year if include==1 & includenew==1 & incquart>2, fe vce(cluster panelidGWE)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "High"
  estadd local  TV  "Yes" 

   
esttab using "regression3cInc.tex", replace f  ///
 b(2) se(2) ///
 keep(ATET ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of energy poverty on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
 mgroups("Sympathy Green Left" "Price Increases Priority" "Immigrants Must adapt" "Oppose EU Integration" "Left-Right" , pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Income" "TV Time varying ") sfmt(2)
 
 * Appendix table with all observations, energy poverty
 esttab using "regression3cappendixInc.tex", replace f  ///
 b(2) se(2) ///
 drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  title(Effect of energy poverty on support for radical right after reform \label{reg1}) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
 mgroups("Sympathy Green Left" "Price Increases Priority" "Immigrants Must adapt" "Oppose EU Integration" "Left-Right" , pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Income" "TV Time varying ") sfmt(2)
 

 
 

  *Using estout package for LatexTables	  	  
est clear
  xtset panelidGWE year
eststo: xtreg  extremeright  ATET  i.year if include==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  extremeright ATET i.oplcat   lninc i.employ renter  i.year if include==1, fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  extremeright  ATET ownservice i.year if include2==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  extremeright ATET ownservice i.oplcat   lninc i.employ renter i.year if include2==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes"

   xtset panelidGWE year
eststo: xtreg  PVVsympmean  ATET  i.year if include==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
 estadd local  TV  "No"
 
eststo: xtreg  PVVsympmean ATET i.oplcat   lninc i.employ renter  i.year if include==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
 estadd local  TV  "No"
 
xtset nomem_encr year
eststo: xtreg  PVVsympmean  ATET ownservice i.year if include2==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "No"
  estadd local  TV  "Yes"
eststo: xtreg  PVVsympmean ATET ownservice i.oplcat   lninc i.employ renter i.year if include2==1 , fe vce(cluster nomem_encr)
 estadd local  FE  "Yes"
 estadd local  TE  "Yes"
 estadd local  CNTL  "Yes"
  estadd local  TV  "Yes" 
 
 


*Table with all the control variables

  *Table with all the control variables
  esttab using "regression3appendixb.tex", replace f   ///
 b(2) se(2) ///
 drop(_cons 2008.year 2009.year 2010.year 2011.year 2012.year 2013.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year ) ///
  star(* 0.10 ** 0.05 *** 0.01) ///
 label booktabs nomtitle collabels(none) compress alignment(D{.}{.}{-1}) ///
  mgroups("Vote for Radical Right" "Relative Sympathy PVV", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) ) ///
 scalars( "N Obs."  "rho \$\rho\$" "TE Time FE" "FE Individual FE" "CNTL Controls" "TV Time varying ") sfmt(2)

 


   
 

 
 

 